// import 'package:PearPark/utils/file.dart';
// import 'package:flutter_downloader/flutter_downloader.dart';
// import 'package:flutter_easyloading/flutter_easyloading.dart';

// class DownloadMan {
//   static final DownloadMan instance = DownloadMan._interval();
//   factory DownloadMan() {
//     return instance;
//   }
//   DownloadMan._interval() {
//     init();
//   }
//   init() {}

//   Future<void> register() async {
//     await FlutterDownloader.initialize(
//         debug: true // optional: set false to disable printing logs to console
//         );
//   }

//   Future<String?> download({
//     required String url,
//     required String name,
//   }) async {
//     var _path = await FileManager().downloadPath();
//     if (_path == null) {
//       EasyLoading.showToast('不支持存储');
//       return null;
//     }
//     return await FlutterDownloader.enqueue(
//       url: url,
//       savedDir: _path,
//       showNotification:
//           true, // show download progress in status bar (for Android)
//       openFileFromNotification:
//           true, // click on notification to open downloaded file (for Android)
//     );
//   }
// }
